Downhole tool analysis using anomaly detection of measurement data

ABSTRACT

A method and system for detecting an anomaly in measurement data captured by a downhole tool is disclosed provided. In the method and system, measurement data comprising a plurality of measurement channels is obtained and reference data including healthy reference data and faulty reference data is also obtained. The measurement data is preprocessed by modeling at least one measurement channel of the plurality of measurement channels using modeling parameters to produce pre-processed measurement data. Further, a first distance between the pre-processed measurement data and the healthy reference data is obtained and determined to exceed a first threshold for the first distance. A report is generated in response to determining that the first distance exceeds the first threshold. The report indicates detection of the anomaly in the measurement data

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to U.S. Provisional Application62/235,071, filed Sep. 30, 2015, the entirety of which is incorporatedby reference.

FIELD OF THE INVENTION

Some embodiments described herein generally relate to systems andapparatuses for downhole tool analysis. Additional embodiments describedherein generally relate to methods for downhole tool analysis based onanomaly detection of measurement data.

BACKGROUND

Downhole tools are used for exploring oil and natural gas deposits underthe Earth's surface. A downhole tool may be equipped with a number ofsensors that capture measurements used for determining the viability ofoil or natural gas exploration. A downhole tool may be used in alogging-while-drilling operation, whereby various measurements arecaptured as the tool drills and descends under the surface of the Earth.During operation, malfunction of the downhole tool causes noise andother artifacts to be introduced in the measurements captured by thedownhole tool. The noise and artifacts corrupt the captured data. Thenoise and artifacts also result in uncertainty in determinations byexploration personnel as to whether an explored area includes oil or gasdeposits. Maintenance and repair of the downhole tool ahead of drillingmitigate the noise or artifacts introduced in the captured measurements.

SUMMARY

This summary is provided to introduce a selection of concepts that arefurther described below in the detailed description. This summary is notintended to identify key or essential features of the claimed subjectmatter, nor is it intended to be used as an aid in limiting the scope ofthe claimed subject matter.

A method for detecting an anomaly in measurement data captured by adownhole tool is disclosed. Measurement data comprising a plurality ofmeasurement channels for a time point of a plurality of time points isobtained. Reference data including healthy reference data and faultyreference data is also obtained. The measurement data is pre-processedby modeling at least one measurement channel of the plurality ofmeasurement channels using modeling parameters to produce pre-processedmeasurement data. The method includes determining a first distancebetween the pre-processed measurement data and the healthy referencedata and determining that the first distance exceeds a first thresholdfor the first distance. The method also includes generating a reportindicating detection of the anomaly in the measurement data in responseto determining that the first distance exceeds the first threshold forthe first distance.

A system that includes a measurement data storage that storesmeasurement data comprising a plurality of measurement channels isdisclosed. The system also includes a reference data storage that storeshealthy reference data and faulty reference data and a detection systemthat is coupled to the measurement data storage and the reference datastorage. The detection system obtains the measurement data from themeasurement data storage and the healthy reference data and the faultyreference data from the reference data storage. The detection systempre-processes the measurement data by modeling at least one measurementchannel of the plurality of measurement channels using modelingparameters to produce pre-processed measurement data. The detectionsystem determines a first distance between the pre-processed measurementdata and the healthy reference data. The detection system alsodetermines that the first distance exceeds a first threshold for thefirst distance and outputs a report indicating detection of an anomalyin the measurement data in response to determining that the firstdistance exceeds the first threshold.

A method for detecting an anomaly in measurement data captured by adownhole tool includes obtaining the measurement data, whereby themeasurement data includes a plurality of measurement channels for a timepoint of a plurality of time points at which measurements were recorded.The method includes obtaining reference data including healthy referencedata and faulty reference data and training a classification algorithmusing the healthy reference data and faulty reference data. The at leastone measurement channel of the plurality of measurement channels ismodelled using modeling parameters. Pre-processed measurement data isproduced based on modelling the at least one measurement channel of theplurality of measurement channels. The method includes determiningwhether the measurement data is classified as healthy or faulty based atleast in part on evaluating the pre-processed measurement data using theclassification algorithm. The method further includes outputting areport indicating that the measurement data is faulty in response todetermining that the measurement data is classified as faulty.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

In the drawings, sizes, shapes, and relative positions of elements arenot drawn to scale. For example, the shapes of various elements andangles are not drawn to scale, and some of these elements may have beenarbitrarily enlarged and positioned to improve drawing legibility.

FIG. 1 depicts an environment for downhole tool health prognosis in adrilling operation according to one or more embodiments disclosedherein;

FIG. 2 depicts an example of measurement data recorded by the downholetool according to one or more embodiments disclosed herein;

FIG. 3 depicts a flow diagram of a method for pre-processing measurementdata according to one or more embodiments disclosed herein;

FIG. 4 depicts a flow diagram of a method for classifying themeasurement data according to one or more embodiments disclosed herein;

FIG. 5 depicts a flow diagram of a method for performing a Mahalanobisdistance analysis on the measurement data according to one or moreembodiments disclosed herein;

FIG. 6 depicts an example of a distribution of the Mahalanobis distancesof measurement data of a drilling operation according to one or moreembodiments disclosed herein;

FIG. 7 depicts an example of a CART-based classification of measurementdata according to one or more embodiments disclosed herein;

FIG. 8 depicts measurement data classification using the CART algorithmaccording to one or more embodiments disclosed herein; and

FIG. 9 depicts magnitudes by which channels of measurement datacontributed to a faulty classification according to one or moreembodiments disclosed herein.

DETAILED DESCRIPTION

FIG. 1 depicts an environment 100 for downhole tool 102 health prognosisin a drilling operation according to one or more embodiments disclosedherein. The environment 100 includes a downhole tool 102, a measurementdata storage system 104, a detection system 106 and a reference datastorage system 108. The downhole tool 102 further includes a pluralityof sensors 110 (singularly referred to herein as sensor 110). Thedownhole tool 102 may, for example, be a drilling apparatus used forexploration of oil or gas under the Earth's surface.

The sensors 110 of the downhole tool 102 may be used to capturemeasurements at various depths of a borehole in a logging-while-drillingenvironment. The sensors 110, which may be antennas or detectors, mayperform Nuclear Magnetic Resonance (NMR) measurements. Nuclear MagneticResonance enables measuring the porosity and permeability of the Earth'srock and characterizing pore spaces in a drilling environment and thefluid in the pore spaces. In addition, the downhole tool 102 may makevarious other measurements such as the temperature of the downhole tool102 and sensor or antenna resonant frequency.

In Nuclear Magnetic Resonance (NMR) measurements, early echo ringingintroduces undesirable artifacts in the measured data. The artifactsresult from excess energy or voltage captured by a sensor 110. Theringing leads to uncertainty about the measured data and introducesnoise in the recorded data. The noise may hinder an operator's abilityto use the data for detecting the presence of natural resources underthe Earth's surface. Reducing the noise introduced by the downhole tool102 results in the recorded data more accurately reflecting the soughtmeasurements. The data captured by the downhole tool 102 is evaluated todetect an anomaly or failure as described herein. If an anomaly orfailure is detected, the downhole tool 102 may be serviced or repairedto mitigate or eliminate the introduced artifacts. More reliablemeasurement data may then be obtained by the downhole tool 102.

Still referring to FIG. 1, the measurement data captured by the downholetool 102 is stored in the measurement data storage system 104. Themeasurement data storage system 104 may be any type of device capable ofstoring data, such as a hard drive or solid-state drive, among others.The measurement data may be provided to the measurement data storagesystem 104 as measurement are made in real-time. For example, as thedownhole tool 102 descends deeper and makes measurements at variousdepths, the measurement data may be sent to the measurement data storagesystem 104. The measurement data may be sent wirelessly over any type ofwireless link. Further, the measurement data may also be sent over awired link. The measurement data may be stored locally by the downholetool 102 and may be provided to the measurement data storage system 104once the measurements for an entire depth of a well are completed.

The measurement data may then be provided to the detection system 106.The detection system 106 may include one or more computationalresources, memory resources and/or networking resources, among others.For example, the detection system 106 may be a computer or a server. Thedetection system 106 evaluates the measurement data to determine whetheran anomaly or failure is present in the measurement data. The detectionsystem 106 may be coupled to the reference data storage system 108. Thereference data storage system 108 stores both healthy reference data andfaulty reference data. The healthy reference data may be a sample ofmeasurement data identified as being healthy. The healthy reference datamay, for example, be previously made measurement data identified ashaving no or minimal early echo ringing artifacts or other noiseintroduced by the downhole tool 102. The healthy reference data may beused as a baseline as described herein for comparison with themeasurement data. Based on the comparison, a degree of similaritybetween the measurement data and the healthy reference data may bedetermined and used for identifying whether the measurement data may beclassified as healthy. If the measurement data is classified as healthy,it may be concluded the downhole tool 102 is operating as desired andmay not need repair or maintenance.

Similarly, the faulty reference data may be a sample of measurement dataidentified as being faulty. The faulty reference data may, for example,be a previously made data measurement identified as having a high degreeof early echo ringing or other artifacts. The faulty reference data maybe used as a baseline for comparison with the measurement data anddetermining whether the measurement data may be classified as faulty.

The measurement data may be categorized as an anomaly if the measurementdata deviates from the healthy references data. The measurement data maybe categorized as faulty if the measurement data corresponds to theproperties of the faulty reference data.

FIG. 2 depicts an example of measurement data made by the downhole tool102 according to one or more embodiments disclosed herein. At variousdepths, the downhole tool 102 may make various measurements. Themeasurements are shown to include a depth measurement 202, a timemeasurement 204, a Nuclear Magnetic Resonance measurement 206, anantenna tuning measurement 208, a tool temperature measurement 210 andan antenna resonant frequency 212. It is recognized that themeasurements shown in FIG. 2 are exemplary and in various embodimentsadditional or different measurements may be made and recorded. Themeasurements are shown in FIG. 2 for one depth or time point. However,as may be recognized, the measurement data includes measurements thatare made at a plurality of depths or time points.

At each depth some of the measurements may be array measurements thatare represented by a vector or a string of values. For example, as shownin FIG. 2, the Nuclear Magnetic Resonance measurement 206 and theantenna tuning measurement 208 are each array measurements that arerepresented by a plurality of values for each depth measurement 202 ortime measurement 204. The depth measurement 202 may represent the depthto which the downhole tool 102 descended or at which the various othermeasurements were made. The time measurement 204 may represent thelength of time that elapsed from the time at which the downhole tool 102began its descent. On the other hand, the tool temperature measurement210, as well as the antenna resonant frequency, may be represented bysingle quantity as opposed to an array. Each type of measurement made bythe downhole tool 102 is referred to herein as a channel.

After collecting and recording the measurement data by the downhole tool102, the data may be pre-processed ahead of detecting whether themeasurement data is to be categorized as faulty or as anomalous.Pre-processing the measurement data may be performed by the detectionsystem 106 described with reference to FIG. 1. In alternativeembodiments, a separate pre-processing system may be provided forpre-processing the measurement data. The data that is pre-processed bythe pre-processing system may then be provided to the detection system106 for evaluation. Similar to the detection system 106, thepre-processing system may include computational resources. Thepre-processing system may be any type of computer equipped with aprocessor. For example, the pre-processing system may be a laptopcomputer that is equipped with a central processing unit (CPU).

Pre-processing the measurement data reduces the volume of themeasurement data used for anomaly or fault detection. Pre-processing themeasurement data also makes anomaly or fault detection morecomputationally efficient. That is because the detection systemevaluates a smaller set of pre-processed measurement data to detect ananomaly or fault as opposed to a larger set of captured measurementdata. Pre-processing may remove redundancies in the measurement data andmodel the measurement data or channels thereof using modelingparameters.

FIG. 3 depicts a method for pre-processing measurement data according toone or more embodiments disclosed herein. In the method 300, thedetection system 106 described with reference to FIG. 1 receives, atblock 302, the measurement data from the measurement data storagesystem. The measurement data as described herein includes channels thatare represented by arrays of multiple quantities. For example, theNuclear Magnetic Resonance measurement 206 may include over a thousandsamples for each depth. At block 304, the detection system 106 performschannel modeling on array channels. Different types of channels may bemodeled differently. For example, the Nuclear Magnetic Resonance echomeasurement channel data may be a logarithmic decay and log-linearfitting may be used to represent the measurement data more compactly. Inlog-linear fitting, the logarithmic decay data may be segmented into twoor more segments and each segment may be represented by modelingparameters, such as an intercept and a slope for the segment. Further,an indication of a residual value of the measured Nuclear MagneticResonance to the fitted line may be provided for each segment.

Accordingly, an array of several hundred or thousand measurements may bemodeled and represented by a much smaller number of modeling parameters.Some measurement channels may be frequency responses that are modeledusing a peak amplitude of the measured data and a frequency at the peakamplitude of the measured data. Thus, an array of hundreds ofmeasurements may be represented using the two modeling parameters ofpeak amplitude and frequency.

At block 306, the detection system 106 performs correlation on thechannels of the measurement data and discards highly correlatedmeasurement channels. A high correlation, as measured by a correlationcoefficient of near 1 or near −1, between a first measurement channeland a second measurement channel indicates that the first measurementchannel is a linear transformation of the second measurement channel orvice-versa. Accordingly, utilizing both measurement channels may beredundant and one of the two measurement channels may be removed fromfurther evaluation.

The detection system 106 then applies rule-based filtering to remove aset of measurement channels of the measurement data at block 308. Forexample, certain measurement channels of the measurement data may notfactor in determining whether the measurement data is faulty. Thesemeasurement channels may be removed from the pre-processed measurementdata set. The detection system 106 then outputs the pre-processedmeasurement data 310.

The pre-processed measurement data is evaluated by the detection system106 to determine whether the measurement data is to be classified asfaulty or anomalous. The measurement data is classified as faulty if themeasurement data is determined to have attributes that correspond tothose of the faulty reference data. Further, the measurement data isclassified as anomalous if the measurement data is determined to haveattributes that are different than those of the healthy reference data.

Two techniques are described herein for classifying the measurementdata. In the first technique, a clustering algorithm, such as theMahalanobis distance, is used for determining whether the measurement isto be classified as faulty or anomalous. For example, the Mahalanobisdistance between the pre-processed measurement data and the healthyreference data or between the pre-processed measurement data and thefaulty reference data may be obtained and used for determining whetherthe measurement is to be classified as faulty or anomalous. In thesecond technique, a classification algorithm, such as the classificationand regression tree (CART) algorithm or the random forest algorithm, istrained with the healthy reference data and the faulty reference data.After the training, the classification algorithm is used to classify thepre-processed measurement data. Reference is made herein to T. Hastie,R. Tibshirani and J. H. Friedman, “The elements of statistical learning:Data mining, inference, and prediction,” New York: Springer Verlag,2001, L. Breiman, J. H. Friedman, R. A. Olshen, and C. J. Stone,“Classification and regression trees,” Monterey, Calif.: Wadsworth &Brooks/Cole Advanced Books & Software, 1984 and L. Breiman, “RandomForests,” Machine Learning, Vol. 45, pp. 5-32, 2001, which describe theCART algorithm and the random forest algorithm, among others, and arehereby incorporated by reference herein in their entirety as if fullyset forth.

FIG. 4 depicts a flow diagram of a method for classifying themeasurement data according to one or more embodiments disclosed herein.In the method 400, the detection system 106 obtains the pre-processedmeasurement data at block 402. As described herein, the recordedmeasurement data may be compressed and the redundancies of themeasurement data may be removed to obtain the pre-processed measurementdata.

The detection system 106 then obtains, at block 404, the reference data,which includes the healthy reference data and the faulty reference data.At block 406, the detection system 106 applies a clustering algorithm ora classification algorithm to the pre-processed measurement data and thereference data to determine whether the measurement data is faulty oranomalous. As described herein, the clustering algorithm may be theMahalanobis distance and the classification algorithm may be the CARTalgorithm or a random forest algorithm. At block 408, the detectionsystem 106 outputs a report indicating if the measurement data is faultyor anomalous. The report may be used for determining whether thedownhole tool 102 is to be serviced or repaired, for example, if thedata is classified as anomalous or faulty.

FIG. 5 depicts a flow diagram of a method for performing a Mahalanobisdistance analysis according to one or more embodiments disclosed herein.In the method 500, the detection system 106 determines a firstMahalanobis distance 502 between the pre-processed measurement data andthe healthy reference data. The first Mahalanobis distance is determinedas:

MD₁({right arrow over (x)},{right arrow over (y)})=√{square root over(({right arrow over (x)}−{right arrow over (y)})^(T) S ⁻¹({right arrowover (x)}−{right arrow over (y)}))}  (Equation (1))

where {right arrow over (x)} is a vector that includes the pre-processedmeasurement data, {right arrow over (y)} is a vector that includes thehealthy reference data, S is the covariance matrix, (.)⁻¹ represents thematrix inverse operator and (.)^(T) represents the transpose operator.

The Mahalanobis distance between the pre-processed measurement data andthe healthy reference data is indicative of the deviation of thepre-processed measurement data from the healthy reference data. Arelatively small Mahalanobis distance is indicative of relatively highdegree of similarity between the pre-processed measurement data and thehealthy reference data. Conversely, a relatively high Mahalanobisdistance is indicative of a relatively low degree of similarity betweenthe pre-processed measurement data and the healthy reference data.

A first threshold for the first Mahalanobis distance is set orestablished such that if the first Mahalanobis distance exceeds thefirst threshold, the pre-processed measurement data is classified asanomalous. Conversely, if the first Mahalanobis distance does not exceedthe first threshold, the pre-processed measurement data is classified ashealthy. As may be recognized, reducing the first threshold increasesthe likelihood of false positives, i.e., mistakenly classifyingpre-processed measurement data as anomalous when in fact thepre-processed measurement data is healthy. The first threshold for thefirst Mahalanobis may be set such that 99% of Mahalanobis distancescalculated for various trials of measurement data are below the firstthreshold and only 1% are equal to or above the first threshold.Furthermore, in a less restrictive scenario, the first threshold may beset such that 95% of Mahalanobis distances calculated for various trialsof measurement data are below the first threshold and 5% are above thefirst threshold.

Following determining the first Mahalanobis distance, the detectionsystem 106 determines whether the first Mahalanobis distance is greaterthan the first threshold 504. If a positive determination is made, thepre-processed measurement data is classified as anomalous 508 and if anegative determination is made, the pre-processed measurement data isclassified as healthy 506.

The first Mahalanobis distance may be calculated for every depth forwhich data measurements are obtained by the downhole tool 102. Thevector {right arrow over (x)} may include the pre-processed measurementdata for the depth, whereas the vector {right arrow over (y)} mayinclude the healthy reference data for the depth. The downhole tool 102may make measurement at hundreds or thousands of depths or time pointsand the first Mahalanobis distances may be obtained for each depth ortime point.

If the pre-processed measurement data is classified as anomalous, thepre-processed measurement data may be further evaluated to determinewhether the pre-processed measurement data has similar attributes asthose of the faulty reference data and may be further classified asfaulty. It is noted that classifying the pre-processed measurement dataas anomalous with respect to the healthy reference data facilitatesanalyzing the downhole tool 102. The anomaly may trigger assessment andanalysis of the downhole tool 102 for the presence of a malfunction.Accordingly, evaluating whether the pre-processed measurement data is tobe categorized faulty as described herein may be forgone.

The detection system 106 determines a second Mahalanobis distancebetween the pre-processed data and the faulty reference data 510.Similar to the first Mahalanobis distance, the second Mahalanobisdistance may be determined as:

MD₂({right arrow over (x)},{right arrow over (z)})=√{square root over(({right arrow over (x)}−{right arrow over (z)})^(T) S ⁻¹({right arrowover (x)}−{right arrow over (z)}))}  (Equation (2))

where {right arrow over (x)} is a vector that includes the pre-processedmeasurement data for a certain depth 202 or time point 204 and {rightarrow over (z)} is a vector that includes the faulty reference data forthe depth 202 or time point 204 and S is the covariance matrix.

At every depth 202 or time point 204, the second Mahalanobis distance(MD₂) may be determined. The detection system 106 then determineswhether the second Mahalanobis distance is greater than a secondthreshold 512. If the second Mahalanobis distance is determined to begreater than the second threshold, then the process ends and thepre-processed measurement data, for example, for the depth 202, remainsclassified as anomalous. Conversely, if a negative determination ismade, the pre-processed measurement data is classified as faulty 514.

It is noted that another clustering algorithm, such as K-meansclustering, may be used to classify the measurement data and determinewhether the measurement data is healthy or faulty. Further, a differentmulti-dimensional distance metric may be used in place of theMahalanobis distance for determining the distance between themeasurement data and the healthy or faulty reference data.

FIG. 6 depicts an example of a distribution of the Mahalanobis distancesof measurement data of a drilling operation according to one or moreembodiments disclosed herein. The distribution of the Mahalanobisdistances for data measurements made at various time points indicatesthat about 90% of the Mahalanobis distances are between 4 and 5.Further, only 1% of the Mahalanobis distances are greater than 7.52.Further, temporally plotting the Mahalanobis distances shows indicatesthat failure was observed in the measurements made between the 10th and19th hour of the drilling operation as represented by spikes of theMahalanobis distances for these measurement. Outside of the rangebetween the 10th and 19th hour, a failure was not detected.

It is noted that the Mahalanobis distance may be used for predictingfailure. For example, if the Mahalanobis distance is detected to betrending higher with respect to time, the upward trend in theMahalanobis distance may be used to forecast an upcoming failure.

The detection system may use the classification and regression tree(CART) algorithm described herein for determining whether measurementdata is faulty or anomalous. The CART algorithm may be trained by thehealthy and faulty reference data measurements. The CART algorithmprovides a set of rules for optimally dividing a boundary between thehealthy and faulty class. The CART algorithm may create non-linearboundaries between the healthy and faulty reference data measurementsthat are more optimum than linear boundaries.

At each node of the CART algorithm, a determination is made aboutwhether the measurement data meets a specific criterion. Depending onwhether the measurement data meets the criterion, a tree will branch toanother node where another determination is made about the measurementdata. The CART algorithm continues to branch until a final determinationis made about the measurement data.

Similar to the Mahalanobis distance, the CART algorithm may be appliedto every vector of measurement data or pre-processed data thereof thatis recorded at a certain depth or time point. The CART algorithm thenrenders a binary determination as to whether the measurement data is tobe classified as healthy or faulty.

FIG. 7 depicts an example of a CART-based classification of measurementdata according to one or more embodiments disclosed herein. Aftertraining the CART algorithm with the healthy and faulty referencemeasurement data, the CART algorithm develops a decision tree fordetermining whether measurement data is healthy or faulty. The decisiontree includes a plurality of nodes 602 to query the measurement data.Based on the outcome of the query at a node, the branch 604 of thedecision tree is followed to a subsequent node 602, where themeasurement data is queried again. The branches 604 of the decision treeare followed until the tree terminates and the measurement data isclassified as healthy 606 or faulty 608.

Following training the CART algorithm, the decision tree is provided tothe detection system 102 described with reference to FIG. 1. As shown inthe example of FIG. 7, the detection system 102 initially determineswhether the measured temperature of the measurement data is greater than42 degrees. If a positive determination is made, the detection system102 determines if the slope of the first NMR measurement segment isgreater than 1 and depending on the outcome of the query, the detectionsystem 102 queries the measurement data in accordance with another nodeof the decision tree.

If, on the other hand, a negative determination is made, the detectionsystem 102 determines if the antenna resonant frequency of themeasurement data is greater than 100 MHz. Depending on the outcome ofthe query, the detection system 102 queries the measurement data inaccordance with another node of the decision tree. The branches 604 ofthe decision tree are followed to respective nodes 602 until thedecision tree terminates with a classification indicating whether themeasurement data is determined to be healthy 606 or faulty 608.

FIG. 8 depicts measurement data classification using the CART algorithmaccording to one or more embodiments disclosed herein. In FIG. 8, avalue of ‘1’ indicates healthy measurement data, whereas a value of ‘0’indicates faulty data. As illustrated in FIG. 8, the majority of themeasurement data recorded by the downhole tool 102 is healthy with theexception of the measurement data recorded between the 22nd and 25thhours of operation, which is classified as faulty. The outcomes of theclassification by the CART algorithm may be used to generate a reportindicating that the downhole tool 102 should be serviced or repaired.

In addition to classifying the data as healthy of faulty, the CARTalgorithm may be used by the detection system 106 to identify thechannels of the measurement data that contributed to the determinationof a faulty classification. The CART algorithm may provide the detectionsystem 106 with a weight associated with each channel of measurementdata. The weight may indicate the degree to which the channel ofmeasurement data contributed to the faulty classification rendered bythe CART algorithm.

FIG. 9 depicts magnitudes by which channels of measurement datacontributed to a faulty classification according to one or moreembodiments disclosed herein. In FIG. 9, the measurement data has 57channels. Three of the channels were associated with a relatively highcontribution to the faulty classification of the measurement data. Theidentification of the primary contributing channels to the faultyclassification may be provided in a report generated by the detectionsystem 106. Further, the identification may be used by personnel for therepair or maintenance of the downhole tool.

In addition, the identification of the primary contributing channels maybe a signature or a pattern associated with a certain malfunction of thedownhole tool 102. Different malfunctions of the downhole tool 102 mayintroduce different noise or errors in the measured data. When aparticular malfunction occurs, a pattern of noise or errors mayintroduced in the measured data. The pattern may be detected by thedetection system 106 as a result of performing the CART algorithm on themeasured data and identifying the contribution of the channels of themeasurement data. The pattern may be used to pinpoint the malfunction ofthe downhole tool 102 that resulted in the measurement data beingclassified as faulty.

It is noted that various classification algorithms, such as the randomforest algorithm, may be trained with the healthy reference data and thefaulty reference data to obtain a classifier usable to classify themeasurement data. Further various combinations of classificationalgorithms may be used. For example, a multiple tree structure of thesame classification algorithm or of differing classification algorithmsmay be implemented.

A few example embodiments have been described in detail above; however,those skilled in the art will readily appreciate that many modificationsare possible in the example embodiments without materially departingfrom the scope of the present disclosure or the appended claims.Accordingly, such modifications are intended to be included in the scopeof this disclosure. Likewise, while the disclosure herein contains manyspecifics, these specifics should not be construed as limiting the scopeof the disclosure or of any of the appended claims, but merely asproviding information pertinent to one or more specific embodiments thatmay fall within the scope of the disclosure and the appended claims. Anydescribed features from the various embodiments disclosed may beemployed in combination. In addition, other embodiments of the presentdisclosure may also be devised which lie within the scope of thedisclosure and the appended claims. Additions, deletions andmodifications to the embodiments that fall within the meaning and scopesof the claims are to be embraced by the claims.

Certain embodiments and features may have been described using a set ofnumerical upper limits and a set of numerical lower limits. It should beappreciated that ranges including the combination of any two values,e.g., the combination of any lower value with any upper value, thecombination of any two lower values, or the combination of any two uppervalues are contemplated. Certain lower limits, upper limits and rangesmay appear in one or more claims below. Numerical values are “about” or“approximately” the indicated value, and take into account experimentalerror, tolerances in manufacturing or operational processes, and othervariations that would be expected by a person having ordinary skill inthe art.

The various embodiments described above can be combined to providefurther embodiments. These and other changes can be made to theembodiments in light of the above-detailed description. In general, inthe following claims, the terms used should not be construed to limitthe claims to the specific embodiments disclosed in the specificationand the claims, but should be construed to include other possibleembodiments along with the full scope of equivalents to which suchclaims are entitled. Accordingly, the claims are not limited by thedisclosure.

1. A method for detecting an anomaly in measurement data captured by adownhole tool, comprising: obtaining the measurement data, themeasurement data comprising a plurality of measurement channels for atime point of a plurality of time points at which measurements wererecorded; obtaining reference data including healthy reference data andfaulty reference data; pre-processing the measurement data by modelingat least one measurement channel of the plurality of measurementchannels using modeling parameters to produce pre-processed measurementdata; determining a first distance between the pre-processed measurementdata and the healthy reference data; determining that the first distanceexceeds a first threshold for the first distance; and generating areport indicating detection of the anomaly in the measurement data inresponse to determining that the first distance exceeds the firstthreshold for the first distance.
 2. The method of claim 1, wherein thepre-processing of the measurement data further includes: determining acorrelation coefficient between a first measurement channel of theplurality of measurement channels and a second measurement channel ofthe plurality of measurement channels; determining whether thecorrelation coefficient exceeds a threshold for the correlationcoefficient; and excluding at least one of the first measurement channeland the second measurement channel from the pre-processed measurementdata if the correlation coefficient exceeds the threshold for thecorrelation coefficient.
 3. The method of claim 1, wherein the at leastone measurement channel comprises an array of measurements and whereinmodeling the at least one measurement channel further includes linearlyfitting at least one segment of the array and representing the at leastone segment by the modeling parameters that include a slope and anintercept.
 4. The method of claim 1, further comprising: determining asecond distance between the pre-processed measurement data and thefaulty reference data; determining that the second distance exceeds asecond threshold; indicating in the report that the measurement data isfaulty in response to determining that the second distance exceeds thesecond threshold; and initiating repair of the downhole tool based atleast in part on the report.
 5. The method of claim 1, wherein the firstdistance is a Mahalanobis distance.
 6. A system comprising: ameasurement data storage that stores measurement data comprising aplurality of measurement channels; a reference data storage that storeshealthy reference data and faulty reference data; a detection system,coupled to the measurement data storage and the reference data storage,that: obtains the measurement data from the measurement data storage;obtains the healthy reference data and the faulty reference data fromthe reference data storage; pre-processes the measurement data bymodeling at least one measurement channel of the plurality ofmeasurement channels using modeling parameters to produce pre-processedmeasurement data; determines a first distance between the pre-processedmeasurement data and the healthy reference data; determines that thefirst distance exceeds a first threshold for the first distance; andoutputs a report indicating detection of an anomaly in the measurementdata in response to determining that the first distance exceeds thefirst threshold.
 7. The system of claim 6 wherein the measurement datais captured at a first time point of a plurality of time points forwhich measurements are captured and the report indicates detection ofthe anomaly at the first time point.
 8. The system of claim 6 whereinthe first distance is a Mahalanobis distance and the plurality ofmeasurement channels include a Nuclear Magnetic Resonance measurementmade by a downhole tool and a tuning measurement and resonant frequencyof an antenna of the downhole tool.
 9. The system of claim 6 wherein theat least one measurement channel comprises an array of measurements andwherein modeling the at least one measurement channel further includeslinearly fitting at least one segment of the array and representing theat least one segment by the modeling parameters.
 10. The system of claim6 wherein the pre-processing of the measurement data further includes:determining a correlation coefficient between a first measurementchannel of the plurality of measurement channels and a secondmeasurement channel of the plurality of measurement channels;determining whether the correlation coefficient exceeds a threshold forthe correlation coefficient; and excluding at least one of the firstmeasurement channel and the second measurement channel from thepre-processed measurement data if the correlation coefficient exceedsthe threshold for the correlation coefficient.
 11. A method fordetecting an anomaly in measurement data captured by a downhole tool,the method comprising: obtaining the measurement data, the measurementdata including a plurality of measurement channels for a time point of aplurality of time points at which measurements were recorded; obtainingreference data including healthy reference data and faulty referencedata; training a classification algorithm using the healthy referencedata and faulty reference data; pre-processing the measurement data bymodeling at least one measurement channel of the plurality ofmeasurement channels using modeling parameters to produce pre-processedmeasurement data; determining whether the measurement data is classifiedas healthy or faulty based at least in part on evaluating thepre-processed measurement data using the classification algorithm; andoutputting a report indicating that the measurement data is faulty inresponse to determining that the measurement data is classified asfaulty.
 12. The method of claim 11 wherein the evaluating of thepre-processed measurement data using the classification algorithmfurther includes querying the plurality of measurement channels at aplurality of nodes of the classification and regression tree algorithm.13. The method of claim 11, wherein the classification algorithm is aclassification and regression tree (CART) algorithm or a random forestalgorithm.
 14. The method of claim 11 wherein the at least onemeasurement channel comprises an array of measurements and wherein themodeling of the at least one measurement channel further includeslinearly fitting at least one segment of the array of measurements andrepresenting the at least one segment by the modeling parameters. 15.The method of claim 11, wherein the at least one measurement channelcomprises an array of measurements and wherein the modeling of the atleast one measurement channel further include representing the array ofmeasurements by a peak amplitude of the array of measurements and afrequency of the array of measurements.